<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link href="./src/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="src/layui.js"></script>
    <script type="text/javascript" src="src/poolEditor.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>词条池编辑器</title>
    <script>
        window.onload = async () => {
            await EditorManager.loadAllData();
            EditorManager.initDirectory();
            EditorManager.renderAll();
        }
    </script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-gray">
        <div class="layui-logo layui-bg-gray">独立物品编辑器</div>
    </div>
    <div class="layui-side">
        <div class="layui-menu layui-menu-lg" id="directory">
        </div>
    </div>
    <div class="layui-body">
        <div class="layui-bg-green layui-font-black" style="padding: 16px;">
            <div class="layui-card">
            <div class="layui-card-header">词条池</div>
            <div class="layui-card-body">
                <form class="layui-form layui-form-pane layui-row layui-col-space16" action="" lay-filter="info">
                    <!--词条池id-->
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">词条池id</label>
                            <div class="layui-input-block">
                                <input type="text" name="id" lay-verify="required"
                                       disabled class="layui-input">
                            </div>
                        </div>
                    </div>
                    <!--词条名字-->
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">词条池名字</label>
                            <div class="layui-input-block">
                                <input type="text" name="name" lay-verify="required" placeholder="请输入"
                                       autocomplete="off" class="layui-input" id="poolName">
                            </div>
                        </div>
                    </div>
                </form>
                <table id="ID-table-pool"></table>
            </div>
        </div>
        </div>
    </div>
    <div class="layui-footer" style="height: 50px">
        <div class="layui-btn-container">
            <div class="layui-input-block" style="margin-top: 5px; float: right;">
                <button type="submit" class="layui-btn layui-btn-primary layui-bg-blue" lay-on="changeMax">更改最大值
                </button>
                <button type="submit" class="layui-btn layui-btn-primary layui-bg-blue" lay-on="saveToFile">保存到本地
                </button>
            </div>
        </div>
    </div>
</div>

<!-- 表格工具栏 -->
<script type="text/html" id="tableBar">
    <div class="layui-clear-space">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
    </div>
</script>

<!--弹出层-->
<!--词条设置-->
<div id="ID-layer-affix" style="display: none;">
    <div class="layui-card">
        <div class="layui-card-header">请设置词条参数</div>
        <div class="layui-card-body">
            <!--选择词条-->
            <div class="layui-row layui-col-space16">
                <div class="layui-col-md3">
                    <label class="layui-form-label layui-font-16">词条选择</label>
                </div>
                <div class="layui-col-md9">
                    <div class="layui-input-wrap layui-form">
                        <input type="text" lay-affix="search" lay-filter="affixsClick" name="affixs"
                               placeholder="词条选择→"
                               class="layui-input" disabled id="affixs">
                    </div>
                </div>
            </div>
            <div class="layui-row layui-col-space16">
                <div class="layui-col-md12">
                    <div class="layui-input-block" style="width: 90%;margin-left: 5%">
                        <input type="text" name="" placeholder="词条列表" class="layui-input" disabled
                               id="affix-show">
                    </div>
                </div>
            </div>
            <hr>
            <div class="layui-row layui-col-space16">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-font-16">出现概率</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" placeholder="请输入"
                               autocomplete="off" class="layui-input" id="affixChance">
                        <div class="layui-input-split layui-input-suffix" style="line-height: 36px">
                            %
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--词条可选项目列表-->
<div id="ID-layer-item-affix-list" style="display: none;">
    <div id="ID-tree-item-affix-list"></div>
</div>

</body>
</html>
